{SysAdd} = require "./SysAdd"
{Srv} = require "Srv"
{SysTree} = require "./SysTree"

SupperClzz = SysAdd
exports["@RoleAdd"] = {comment:"角色增加"}
exports.RoleAdd = new Class
  Extends: SupperClzz
  Implements: [SysTree]
  options:
    enyStr: "Role"
    headArr: ["code","lbl","desc","is_root","is_leaf"]
    headObj:
      "prn_id":"父角色"
      "code":"编码"
      "lbl":"名称"
      "desc":"描述"
      "is_root":"根节点"
      "is_leaf":"子节点"
    $vdts: ["code"]
  initPg: ->
    t = this
    o = t.options
    elt = o.ele
    yield t.initPrn_id()
    yield SupperClzz.prototype.initPg.apply t,arguments
    return
  codeVdt: (key,val,id)->
    t = this
    o = t.options
    if val.trim() is ""
      return {err:"编码不能为空!",time:2}
    rltSet = yield o.thisSrv.ajax "codeVdt",[key,val,id]
    rltSet
  
